#{extends 'main.html' /}

#{set title:'Home' /}

<h1>Page d'accueil</h1>

<script type="text/javascript">

	function refreshEvents(){
		$.ajax('/application/events_json').done(response);
	}
	function response(events)
	{
		$('tr').remove();
		for(var i = 0; i < events.length ; i++){
			console.log(events[i].name);
			var name = '<td>'+ events[i].name + '</td>' 
		var row =	$('<tr>'+ name'</tr>');
			$('table').append(row);
		}
	}

</script>
<a href="@{Application.create_event()}" class="btn btn-primary">Create a new Event </a>
<div class="calendar ">
#{doLayout /}
</div>

